package mac5855.app.dao;

//Abstract class DAO Factory
public abstract class DAOFactory {

	// List of DAO types supported by the factory
	public static final int JDBC = 1;
	public static final int JPA = 2;
	public static String path = "/spring/applicationContext.xml";

	// There will be a method for each DAO that can be
	// created. The concrete factories will have to
	// implement these methods.
	public abstract PerguntaDAO getPerguntaDAO();

	public abstract RespostaDAO getRespostaDAO();

	public abstract CategoriaDAO getCategoriaDAO();

	public abstract UsuarioDAO getUsuarioDAO();

	public abstract DenunciaDAO getDenunciaDAO();

	public static DAOFactory getDAOFactory(int whichFactory) {

		switch (whichFactory) {
		case JDBC:
			return new JdbcDAOFactory();
		case JPA:
			return new JpaDAOFactory();
		default:
			return null;
		}
	}
}
